package com.shine.commonlibrary.utils.api.bean;


import java.util.List;

/**
 * Created by CL on 2017/3/16.
 * 描述：封装服务器返回的公有数据
 */

public class BaseResult<T> implements ResultStatus {

    /**
     * deptID : 4A1F2CEADEC951D8E050007F010036DF
     * deviceID : 4A1F2CEADEC951D8E050007F010036DF
     * list : []
     * obj : {"deptInfoList":[{"deptCode":"01","deptId":"1ABF635288B9474CE053F501A821E067","deptName":"内科","isDefault":"1","pinyin":"nk"},{"deptCode":"04","deptId":"FABF635288B9474CE053F501A821E067","deptName":"泌尿科","isDefault":"0","pinyin":"mnk"},{"deptCode":"05","deptId":"EABF635288B9474CE053F501A831E067","deptName":"耳鼻喉科","isDefault":"0","pinyin":"ebhk"},{"deptCode":"06","deptId":"QABF635288B9464CE053F501A821E067","deptName":"精神科","isDefault":"0","pinyin":"jsk"},{"deptCode":"02","deptId":"1ABF635288B9474CE053F501A831E067","deptName":"五官科","isDefault":"0","pinyin":"wgk"},{"deptCode":"03","deptId":"1ABF635288B9464CE053F501A821E067","deptName":"外科","isDefault":"0","pinyin":"wk"}],"id":"4A1F2CEADEC951D8E050007F010036DF","rfid":"0x4a1aff71","userName":"测试内容ug27","userNum":"123"}
     * page : {}
     * resultCode : 0
     * resultInfo : 操作成功
     * rfid : 测试内容r726
     * token : ddsefafew234t62wefsg43sfs
     * uid : 4A1F2CEADEC951D8E050007F010036DF
     * version : 1
     */

    private String deptID;
    private String deviceID;
    private T obj;//明确返回单条记录时有值
    private PaginationInfo<T> page;
    private String resultCode;
    private String resultInfo;
    private String rfid;
    private String token;
    private String uid;
    private String version;
    private List<?> list;

    @Override
    public boolean isOk() {
        return "0".equals(resultCode) && "操作成功".equals(resultInfo);
    }

    public String getDeptID() {
        return deptID;
    }

    public void setDeptID(String deptID) {
        this.deptID = deptID;
    }

    public String getDeviceID() {
        return deviceID;
    }

    public void setDeviceID(String deviceID) {
        this.deviceID = deviceID;
    }

    public T getObj() {
        return obj;
    }

    public void setObj(T obj) {
        this.obj = obj;
    }

    public PaginationInfo getPage() {
        return page;
    }

    public void setPage(PaginationInfo page) {
        this.page = page;
    }

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getResultInfo() {
        return resultInfo;
    }

    public void setResultInfo(String resultInfo) {
        this.resultInfo = resultInfo;
    }

    public String getRfid() {
        return rfid;
    }

    public void setRfid(String rfid) {
        this.rfid = rfid;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public List<?> getList() {
        return list;
    }

    public void setList(List<?> list) {
        this.list = list;
    }

}
